{include file="public/head"/}
<style>
    .layui-form-item .layui-input-company {
        width: auto;
        padding-right: 10px;
        line-height: 38px;
    }
    .layui-elem-quote {
        border-left: 5px solid #1E9FFF;
    }
</style>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <blockquote class="layui-elem-quote layui-text">
                系统通用参数配置           
            </blockquote>

            <div class="layui-form layuimini-form">
                {volist name="config" id="vo"}
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width: auto">{$vo.title}</label>
                    <div class="layui-input-inline">
                        <input type="text" name="{$vo.name}" lay-verify="required" value="{$vo.value}" class="layui-input" autocomplete="off">
                    </div>
                    <div class="layui-form-mid layui-word-aux">{$vo.explain}</div>
                </div>
                {/volist}

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting">提交设置</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        layui.use(['form'], function () {
            var form = layui.form
                , layer = layui.layer
                ,$ = layui.$;;

            //监听提交
            form.on('submit(setting)', function (data) {
                // 提交到方法 默认为本身
                $.post('', data.field, function (res) {
                    if (res.code > 0) {
                        layer.msg(res.msg, { time: 1800, icon: 1 }, function () {
                            location.reload();
                        });
                    } else {
                        layer.msg(res.msg, { time: 1800, icon: 2 });
                    }
                });
                return false;
            });

        });
    </script>
    {include file="public/footer"/}